import React, { memo } from 'react'

import { getSizeImage } from '@/utils/format-utils'
import {
  AlbumCoverWrapper
} from './style'

export default memo(function DAlbumCover(props) {
  const { info, size = 130, width = 153, bgp = "-845px" } = props

  return (
    <AlbumCoverWrapper width={width} size={size} bgp={bgp}>
      <div className="album-image">
        <img src={getSizeImage(info.picUrl, size)} alt="" />
        <a className="cover image_cover" href="/todo">{info.name}</a>
      </div>
      <div className="album-info">
        <div className="name text-nowrap">{info.name}</div>
        <div className="artist text-nowrap">{info.artist.name}</div>
      </div>
    </AlbumCoverWrapper>
  )
})
